1. Field
The present invention relates to XML parsing, and more particularly to minimizing JNI calls in XML parsing.
2. Related Art
Conventional eXtensible Mark-up Language (XML) parsers are typically written in Java. An example of an XML parser is a SAX push parser, which calls standard event handlers. Java suffers from poor performance. To improve performance, one could write the parser engine in C. In this example, the SAX parser reads a XML document and passes it to C code by making Java Native method Interface (JNI) calls. The C code parses the document and invokes the standard event handlers by function calls via the JNI mechanism, and creates Java object as required (such as strings) via the JNI mechanism. Here, for each event, a call is made from the C code to the Java code, and the Java code returns, via JNI. This is costly in performance.
Accordingly, there exists a need for JNI-minimizing XML parsing. The present invention addresses such a need.